export default {
    state: {
      isCollapse: false,
      tabsList: [
        {
            path:'/shoppersonal',
            name:'myshop',
            label:'我的店铺',
            icon:'s-shop',
        },
      ],
      currentMenu: null,
    },
    mutations: {
      collapseMenu(state) {
        state.isCollapse = !state.isCollapse;
      },
      selectMenu(state, value) {
        if (value.name !== "home") {
          state.currentMenu = value;
          const result = state.tabsList.findIndex(
            (item) => item.name === value.name
          );
          if (result === -1) {
            state.tabsList.push(value);
          }
        } else {
          state.currentMenu = null;
        }
      },
      closeTags(state, value) {
        const result = state.tabsList.findIndex(
          (item) => item.name === value.name
        );
        console.log(result);
        state.tabsList.splice(result, 1);
      },
    },
  };